#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void PrintArr(int* a,int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
} 
void InsertSort(int* a, int n)
{
	int i;
	for (i = 1; i < n; i++)
	{
		int end = i - 1;
		int temp = a[i];
		while (end >= 0)
		{
			if (a[end] > temp)
			{
				a[end + 1] = a[end];
				end--;
			}
			else
				break;
		}
		a[end+1] = temp;
	}
}

int main()
{
	int arr[11] = { 9,5,6,7,8,9,1,2,3,4 };
	InsertSort(arr, sizeof(arr) / sizeof(int));
	PrintArr(arr, sizeof(arr) / sizeof(int));
	return 0;
}